package com.muqi.app.qlearn.student.ui;

import com.muqi.app.qlearn.student.BaseFragmentActivity;
import com.muqi.app.qlearn.student.R;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class SetGroupInfoActivity extends BaseFragmentActivity {

	private EditText ping_lun_shu_ru;
	private TextView pinlun_quxiao, ping_lun_fa_song;
	private String content;
	
  

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// ////设置为true点击区域外消失
		setFinishOnTouchOutside(false);//

		setContentView(R.layout.activity_set_group_info);

	}

	public void PostevaluateHttp() {
		content = ping_lun_shu_ru.getText().toString();
		if (content == null || content.length() <= 0) {
			Toast.makeText(this, "请输入群聊的名称", Toast.LENGTH_SHORT).show();
		} else {
           Intent intent=new Intent();
           intent.putExtra("groupName", content);
           setResult(RESULT_OK, intent);
           finish();
		}

	}

	@Override
	protected void onInit() {

		pinlun_quxiao = (TextView) findViewById(R.id.pinlun_quxiao);
		ping_lun_fa_song = (TextView) findViewById(R.id.ping_lun_fa_song_post);
		ping_lun_shu_ru = (EditText) findViewById(R.id.ping_lun_shu_ru);

		pinlun_quxiao.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});

		ping_lun_fa_song.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				PostevaluateHttp();
			}
		});

	}

	@Override
	protected void onData() {

	}

}
